<template>
   <view class="wrap">
        <view class="title">请先选择一种灵签</view>
        <view class="btnWrap">
            <view class="btn" @tap="changeUrl(idx)" v-for="(item,idx) in arr" :key="idx">{{ item }}</view>
        </view>
   </view>
</template>
<script>
import { getDrawNameListAPI } from '../../../utils/api'
export default {
   data() {
     return {
        current:-1,
        arr:[]
     }
   },
   onShow(){
        this.initData();
   },

   methods: {
        // 初始化标签
        async initData(){
            const res = await getDrawNameListAPI();
            this.arr = res.result
        },

        // 路由跳转
        changeUrl(idx){
            this.current = idx;
            uni.navigateTo({
                url:`../../../subPackagesA/pages/startLots/startLots?name=${this.arr[this.current]}`
            })
        }
   }
};
</script>
<style lang='less' scoped>
.wrap{
    padding: 30rpx;
    .title{
        font-size: 36rpx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #000000;
    }
    .btnWrap{
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        .btn{
            margin: 30rpx 0;
            width: 328rpx;
            height: 200rpx;
            line-height: 200rpx;
            text-align: center;
            background: url('https://ctrlsoft.net.cn/app_static/hesaid/img/randomDream/bg.png');
			background-size: 100% 100%;
            color: #893702;
			font-size: 20px;
			font-weight: 600;
        }
    }
}
</style>